1. Field of the Invention
The present invention relates to an encoding device, a method for adjusting target amounts of code and a record medium, which are suitably applicable to image processing devices, such as an encoder, that encode image data in conformity with coding standards, for example, MPEG (Moving Picture Experts Group).
2. Description of the Related Art
A technique of encoding image data using an encoder before recording and distributing the image and decoding the encoded image data by using a decoder before displaying the image is widely and frequently used. In MPEG-2, as shown in FIG. 1A, a group of pictures (GOPs) is formed with, for example, 15 pictures and serves as a unit of pictures in a repeating sequence.
The MPEG-2 system defines three types of pictures: I-picture; P-picture; and B-picture. The I-picture is generated by using intra-frame coding without changing the pixel values thereof. The P-picture is generated by using forward prediction with reference to a preceding I- or P-picture. The B-picture is generated by using bidirectional prediction with reference to a preceding and following I- or P-picture.
The rate control of each picture according to the MPEG-2 system is proposed in STEP 1 of Test Model (TM) 5. In STEP 1, for the purpose of decreasing the difference in image quality of pictures in a GOP, a difference in amount of code between a target amount of GOP code, which is a target amount of code available to the GOP, and a generation code amount, which is an amount of generated code upon encoding a picture, is accumulated in a virtual buffer. Then, in STEP 1, a target amount of picture code is allocated to pictures, which will be encoded, in accordance with the difference in amount of code and the picture type.
As shown in FIG. 1B, in STEP 1, large target amounts of picture code are allocated to the I-picture and P-pictures used as a reference image, whereas the B-pictures, which are not used as a reference image, are to be allocated with smaller target amounts of picture code than those for the I-picture and P-pictures (see, e.g., Japanese Unexamined Patent Application Publication No. 2008-78978).